<script src="/js/jquery.datatables.min.js"></script>
<script src="/js/chosen.jquery.min.js"></script>
<script>
	$(document).ready(function() {
    $('#table2').dataTable({
      	"bPaginate": false,
        "bLengthChange": false,
        "bFilter": true,
        "bSort": true,
        "bInfo": false,
        "bAutoWidth": false
    });
    
  });
</script>
 <link href="/css/jquery.datatables.css" rel="stylesheet">
<!--thong bao-->
	
<!--thong bao-->
<div class="table-responsive">
	<a class="btn btn-pink" href="/users/add">Thêm User</a>
	<?php echo $this->Session->flash();?>
	<table class="table" id="table2">
		<thead>
			<tr>
                <th>No.</th>                    
                <th>Username</th>                                       
                <th>Email</th>
                <th>Role</th>
                <th>Create User</th>
                <th>Created</th>
                <th>Modified</th>
                <th>Active</th>
                <th>Last login</th>
                <th>Edit</th>
              
            </tr>
		</thead>
		<tbody>
			<?php foreach($data as $item){?>
                <tr>
                    <td><?php echo $item['User']['id'];?></td>
                    <td><?php echo $item['User']['username'];?></td>
                    <td><?php echo $item['User']['email'];?></td>
                    <td><?php echo $item['User']['role'];?></td>
                    <td><?php echo $item['User']['creusr'];?></td>
                    <td><?php echo $item['User']['created'];?></td>
                    <td><?php echo $item['User']['modified'];?></td>
                    <td><?php echo $item['User']['active'];?></td>
                    <td><?php echo $item['User']['lastlogin'];?></td>
                    <td>
                    	<a href="/admin/users/edit/<?php echo $item['User']['id'] ?>"><i class="fa fa-edit"></i></a>
                    	<a href="/admin/users/delete/<?php echo $item['User']['id'] ?>" onclick="if (confirm('Bạn có muốn xóa người dùng này ?')) { return true; } return false;"><i class="fa  fa-times-circle"></i></a>
                    </td>
                </tr>
               	<?php }?>
		</tbody>
	</table>
	<?php echo $this->element('pagination', array('Paginator' => $this->Paginator));?>
</div><!-- table-responsive -->

